{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "age:\t 18\n",
      "name:\t 张三\n"
     ]
    }
   ],
   "source": [
    "class test:\n",
    "    def __init__(self, age, name) -> None:\n",
    "        self.age = age\n",
    "        self.name = name\n",
    "\n",
    "    def printInfo(self):\n",
    "        print('age:\\t', self.age)\n",
    "        print('name:\\t', self.name)\n",
    "\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    t = test(18, \"张三\")\n",
    "    \n",
    "    # print(t.age)\n",
    "    t.printInfo()\n",
    "    "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
